dig one's own grave
Seriously harm oneself, cause one's own ruin or downfall. For example,
If Sam pursues that course, he'll be digging his own grave
.
[
First half of 1900s
]